USE [RD_COMMON]
GO

/****** Object:  Index [PK_Sales_Star_Customer]    Script Date: 08/20/2010 15:22:58 ******/
ALTER TABLE [dbo].[Sales_Star_Customer] ADD  CONSTRAINT [PK_Sales_Star_Customer] PRIMARY KEY CLUSTERED 
(
	[CustomerNumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO



USE [RD_COMMON]
GO

/****** Object:  Index [IX_Sales_Star_CompanyNumber]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [IX_Sales_Star_CompanyNumber] ON [dbo].[Sales_Star_Customer] 
(
	[CompanyNumber] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Sales_Star_Customer_CustomerNumberID]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [IX_Sales_Star_Customer_CustomerNumberID] ON [dbo].[Sales_Star_Customer] 
(
	[CustomerNumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Sales_Star_Customer_ShipToNumber]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [IX_Sales_Star_Customer_ShipToNumber] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Sales_Star_InvoiceToNumber]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [IX_Sales_Star_InvoiceToNumber] ON [dbo].[Sales_Star_Customer] 
(
	[InvoicetoNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Sales_Star_ParentNumber]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [IX_Sales_Star_ParentNumber] ON [dbo].[Sales_Star_Customer] 
(
	[ParentNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Sales_Star_ShipToNumber]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [IX_Sales_Star_ShipToNumber] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [IX_Sales_Star_SoldToNumber]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [IX_Sales_Star_SoldToNumber] ON [dbo].[Sales_Star_Customer] 
(
	[SoldtoNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_1]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_1] ON [dbo].[Sales_Star_Customer] 
(
	[Category03Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[StopCode]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_101]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_101] ON [dbo].[Sales_Star_Customer] 
(
	[Category06Code] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber],
[Category03Code]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_103]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_103] ON [dbo].[Sales_Star_Customer] 
(
	[Category06Code] ASC
)
INCLUDE ( [Category03Code],
[Category03]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_105]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_105] ON [dbo].[Sales_Star_Customer] 
(
	[Category06Code] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber],
[Category05Code]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_107]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_107] ON [dbo].[Sales_Star_Customer] 
(
	[Category06Code] ASC
)
INCLUDE ( [Category05Code],
[Category05]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_109]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_109] ON [dbo].[Sales_Star_Customer] 
(
	[Category06Code] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber],
[Category04Code]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_111]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_111] ON [dbo].[Sales_Star_Customer] 
(
	[Category06Code] ASC
)
INCLUDE ( [Category04Code],
[Category04]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_115]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_115] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoNumber] ASC,
	[StopCode] ASC
)
INCLUDE ( [ShiptoName]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_117]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_117] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoNumber] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_121]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_121] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[DateOfFirstInvoice]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_123]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_123] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchType] ASC
)
INCLUDE ( [SoldtoNumber],
[ShiptoNumber],
[ShiptoSearchTypeCode]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_125]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_125] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[LastInvoiceDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_128]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_128] ON [dbo].[Sales_Star_Customer] 
(
	[Category03Code] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber],
[ShiptoName],
[StopCode]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_144]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_144] ON [dbo].[Sales_Star_Customer] 
(
	[Category03Code] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber],
[StopCode]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_1465]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_1465] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [ParentNumber],
[ParentName],
[ShiptoNumber],
[ShiptoName],
[ShiptoAddressLine01],
[ShiptoPostalCode],
[ShiptoCity],
[ShiptoStateCode],
[ShiptoState],
[Category03Code],
[Category03],
[Category04Code],
[Category04],
[Category05Code],
[Category05],
[Category06Code],
[Category06],
[Category08Code],
[Category08],
[Category21Code],
[Category21],
[Category25Code],
[Category25],
[Category27Code],
[Category27],
[Category28Code],
[Category28]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_147]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_147] ON [dbo].[Sales_Star_Customer] 
(
	[Category08Code] ASC
)
INCLUDE ( [CustomerNumberID],
[SourceID],
[ShiptoNumber],
[Category08]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_1473]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_1473] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC,
	[Category06Code] ASC
)
INCLUDE ( [ParentNumber],
[ParentName],
[ShiptoNumber],
[ShiptoName],
[ShiptoAddressLine01],
[ShiptoPostalCode],
[ShiptoCity],
[ShiptoStateCode],
[ShiptoState],
[Category03Code],
[Category03],
[Category04Code],
[Category04],
[Category05Code],
[Category05],
[Category06],
[Category08Code],
[Category08],
[Category21Code],
[Category21],
[Category25Code],
[Category25],
[Category27Code],
[Category27],
[Category28Code],
[Category28]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_152]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_152] ON [dbo].[Sales_Star_Customer] 
(
	[StopCode] ASC,
	[Category03Code] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber],
[ShiptoName]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_170]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_170] ON [dbo].[Sales_Star_Customer] 
(
	[StopCode] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_177]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_177] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC,
	[Category05Code] ASC,
	[Category06Code] ASC
)
INCLUDE ( [CustomerNumberID],
[SourceID],
[ShiptoNumber],
[Category03Code],
[Category03]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_179]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_179] ON [dbo].[Sales_Star_Customer] 
(
	[Category05Code] ASC
)
INCLUDE ( [Category04Code],
[Category04]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_180]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_180] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC,
	[Category05Code] ASC,
	[Category06Code] ASC
)
INCLUDE ( [CustomerNumberID],
[SourceID],
[ShiptoNumber],
[Category04]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_19]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_19] ON [dbo].[Sales_Star_Customer] 
(
	[Category03Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[LastInvoiceDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_202]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_202] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoSearchTypeCode],
[HOLDORDERSCODEDescription],
[DateOfFirstInvoice],
[LastInvoiceDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_204]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_204] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoSearchTypeCode],
[StopCode],
[DateOfFirstInvoice],
[LastInvoiceDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_206]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_206] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC,
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber],
[ShiptoName],
[StopCode],
[Category03Code]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_208]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_208] ON [dbo].[Sales_Star_Customer] 
(
	[Category03Code] ASC
)
INCLUDE ( [Category03]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_212]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_212] ON [dbo].[Sales_Star_Customer] 
(
	[Category09Code] ASC,
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [ParentNumber],
[ParentName],
[ShiptoNumber],
[ShiptoName],
[ShiptoAddressLine01],
[ShiptoPostalCode],
[ShiptoCity],
[ShiptoStateCode],
[ShiptoState],
[StopCode],
[Category03Code],
[Category03],
[Category04Code],
[Category04],
[Category05Code],
[Category05],
[Category06Code],
[Category06],
[Category08Code],
[Category08],
[Category21Code],
[Category21],
[Category25Code],
[Category25],
[Category27Code],
[Category27],
[Category28Code],
[Category28]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_214]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_214] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC,
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[Category03Code],
[LastInvoiceDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_216]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_216] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC,
	[Category03Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[LastInvoiceDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_225]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_225] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC,
	[Category03Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[ShiptoAddressLine01],
[ShiptoPostalCode],
[ShiptoCity],
[ShiptoStateCode],
[ShiptoState],
[ShiptoSearchType],
[StopCode],
[Category03]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_242]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_242] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoSearchTypeCode],
[DateOfFirstInvoice],
[LastInvoiceDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_272]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_272] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber],
[ShiptoName],
[StopCode],
[Category03Code]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_276]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_276] ON [dbo].[Sales_Star_Customer] 
(
	[StopCode] ASC
)
INCLUDE ( [SourceID],
[ShiptoNumber]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_357]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_357] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [ParentNumber],
[ParentName],
[ShiptoNumber],
[ShiptoName],
[ShiptoAddressLine01],
[ShiptoPostalCode],
[ShiptoCity],
[ShiptoStateCode],
[ShiptoState],
[ShiptoSearchType],
[Category03Code],
[Category03],
[Category04Code],
[Category04],
[Category05Code],
[Category05],
[Category06Code],
[Category06],
[Category08Code],
[Category08],
[Category25Code],
[Category25]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_6]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_6] ON [dbo].[Sales_Star_Customer] 
(
	[Category03Code] ASC
)
INCLUDE ( [SoldtoNumber],
[SoldtoName],
[StopCode]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_648]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_648] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [InvoicetoNumber],
[InvoicetoName],
[SoldtoNumber],
[SoldtoName],
[ShiptoNumber],
[ShiptoName]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_652]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_652] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [CustomerNumberID],
[SourceID],
[ShiptoNumber],
[ShiptoName]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_653]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_653] ON [dbo].[Sales_Star_Customer] 
(
	[Category04Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[Category03Code],
[LastInvoiceDate]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_7]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_7] ON [dbo].[Sales_Star_Customer] 
(
	[Category08Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[DateOfFirstInvoice]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_8]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_8] ON [dbo].[Sales_Star_Customer] 
(
	[Category03Code] ASC
)
INCLUDE ( [StopCode]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_83]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_83] ON [dbo].[Sales_Star_Customer] 
(
	[Category06Code] ASC
)
INCLUDE ( [ShiptoNumber],
[ShiptoName],
[StopCode]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_87]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_87] ON [dbo].[Sales_Star_Customer] 
(
	[Category06Code] ASC
)
INCLUDE ( [CustomerNumberID],
[SourceID],
[ShiptoNumber],
[Category06]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_908]    Script Date: 08/20/2010 15:22:51 ******/
CREATE NONCLUSTERED INDEX [missing_index_908] ON [dbo].[Sales_Star_Customer] 
(
	[ShiptoSearchTypeCode] ASC
)
INCLUDE ( [ParentNumber],
[ParentName],
[ShiptoNumber],
[ShiptoName],
[ShiptoAddressLine01],
[ShiptoPostalCode],
[ShiptoCity],
[ShiptoStateCode],
[ShiptoState],
[StopCode],
[Category03Code],
[Category03],
[Category04Code],
[Category04],
[Category05Code],
[Category05],
[Category06Code],
[Category06],
[Category08Code],
[Category08],
[Category21Code],
[Category21],
[Category25Code],
[Category25],
[Category27Code],
[Category27],
[Category28Code],
[Category28]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO


use RD_common;
go

INSERT INTO [RD_COMMON].[dbo].[Star_Item]
           ([ItemNumberID]
           ,[SourceID]
           ,[Source]
           ,[ItemNumber]
           ,[ItemNumber02]
           ,[ItemNumber03]
           ,[Description01]
           ,[Description02]
           ,[SalesCategory01Code]
           ,[SalesCategory01]
           ,[SalesCategory02Code]
           ,[SalesCategory02]
           ,[SalesCategory03Code]
           ,[SalesCategory03]
           ,[SalesCategory04Code]
           ,[SalesCategory04]
           ,[SalesCategory05Code]
           ,[SalesCategory05]
           ,[SalesCategory06Code]
           ,[SalesCategory06]
           ,[SalesCategory07Code]
           ,[SalesCategory07]
           ,[SalesCategory08Code]
           ,[SalesCategory08]
           ,[SalesCategory09Code]
           ,[SalesCategory09]
           ,[SalesCategory10Code]
           ,[SalesCategory10]
           ,[PurchasingCategory01Code]
           ,[PurchasingCategory01]
           ,[PurchasingCategory02Code]
           ,[PurchasingCategory02]
           ,[PurchasingCategory03Code]
           ,[PurchasingCategory03]
           ,[PurchasingCategory04Code]
           ,[PurchasingCategory04]
           ,[PurchasingCategory05Code]
           ,[PurchasingCategory05]
           ,[PurchasingCategory06Code]
           ,[PurchasingCategory06]
           ,[PurchasingCategory07Code]
           ,[PurchasingCategory07]
           ,[PurchasingCategory08Code]
           ,[PurchasingCategory08]
           ,[PurchasingCategory09Code]
           ,[PurchasingCategory09]
           ,[PurchasingCategory10Code]
           ,[PurchasingCategory10]
           ,[ProductGroupCode]
           ,[ProductGroup]
           ,[ItemPriceGroupCode]
           ,[ItemPriceGroup]
           ,[StockingTypeCode]
           ,[StockingType]
           ,[InsertIndicator]
           ,[InsertDate]
           ,[ChangeIndicator]
           ,[ChangeDate]
           ,[DeleteIndicator]
           ,[DeleteDate]
           ,[PurgeDate])
     VALUES
           (1
           ,1
           , 'FARMER_CUSTOM'
           ,0
           ,'Advanced Pricing Adj Line'
           , 'Advanced Pricing Adj Line'
           , 'Advanced Pricing Adj Line'
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           , ''
           ,0
           ,0
           ,0
           ,0
           ,0
           ,0
           ,0)
